'''
Created on 05/07/2010

@author: Daniel
'''

class DDirectory(object):

    def __init__(self, aName):
        self.root = False
        self.father = None
        self.name = aName
        self.sons = [] 
        self.files = []
        self.inodes = []

    def openDir(self):
        return [self.getSons(),self.getFiles()]
    
    def ls(self):
        return self.openDir()
    
    def getData(self): 
        return self.ls()
    
    def getFiles(self):
        list = []
        for i in self.files:
            list.append(i.toString())
        return list
    
    def getName(self):
        return self.name
    
    def getSons(self):
        list = []
        for i in self.sons:
            list.append(i.toString())
        return list
    
    def toString(self):
        return self.name
    
    def setRoot(self,aBul):
        self.root = aBul
        
    def setFather(self,aDir):
        self.father = aDir
        
    def addFile(self,aFile):
        self.files.append(aFile)
        
    def addSon(self,aDir):
        self.sons.append(aDir)
        

                
